import Home from '../views/Home.vue'
import Layout from '../views/Layout/Layout.vue'
import Userindex from '../views/User/index.vue'
import Adduser from '../views/User/adduser.vue'
import Classifyindex from '../views/Classify/index.vue'
import Addclassify from '../views/Classify/addclass.vue'
import Menuindex from '../views/Menu/index.vue'
import Addmenu from '../views/Menu/addmenu.vue'
import Articalindex from '../views/Artical/index.vue'
import Addartical from '../views/Artical/changeartical.vue'
import Bannerindex from '../views/Banner/index.vue'
import Addbanner from '../views/Banner/addbanner.vue'
import Manager from '../views/Manager/manager.vue'
import Login from '../views/Login/Login.vue'

const adminRoutes = [
    {
        path: '/admin/login',
        component: Login,
        name: "login"
    },
    {
        path: '/',
        redirect: '/admin/dashboard'
    },
    {
        path: '/admin',
        name: 'dashboard',
        redirect: '/admin/dashboard',
        component: Layout,
        children: [
            { path: 'dashboard', name: 'home', component: Home, meta: '后台首页' }
        ]
    },
    {
        path: '/admin/manager',
        name: 'manager',
        redirect: '/admin/manager/index',
        component: Layout,
        children: [
            { path: 'index', name: 'manager', component: Manager, meta: '管理员页面' }
        ]
    },
    {
        path: '/admin/user',
        name: 'user',
        redirect: '/admin/user/index',
        component: Layout,
        children: [
            { path: 'index', name: 'userindex', component: Userindex, meta: '用户首页' },
            { path: 'adduser', name: 'adduser', component: Adduser, meta: '添加用户' }
        ]
    },
    {
        path: '/admin/classify',
        name: 'classify',
        redirect: '/admin/classify/index',
        component: Layout,
        children: [
            { path: 'index', name: 'classifyindex', component: Classifyindex, meta: '分类首页' },
            { path: 'addclassify', name: 'addclassify', component: Addclassify, meta: '添加分类' }
        ]
    },
    {
        path: '/admin/menu',
        name: 'menu',
        redirect: '/admin/menu/index',
        component: Layout,
        children: [
            { path: 'index', name: 'menuindex', component: Menuindex, meta: '菜单首页' },
            { path: 'addmenu', name: 'addmenu', component: Addmenu, meta: '添加菜单' }
        ]
    },
    {
        path: '/admin/artical',
        name: 'artical',
        redirect: '/admin/artical/index',
        component: Layout,
        children: [
            { path: 'index', name: 'articalindex', component: Articalindex, meta: '文章首页' },
            { path: 'addartical', name: 'addartical', component: Addartical, meta: '添加文章' }
        ]
    },
    {
        path: '/admin/banner',
        name: 'banner',
        redirect: '/admin/banner/index',
        component: Layout,
        children: [
            { path: 'index', name: 'bannerindex', component: Bannerindex, meta: '轮播图首页' },
            { path: 'addbanner', name: 'addbanner', component: Addbanner, meta: '添加轮播图' }
        ]
    }
]

export default adminRoutes;